<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE HTML>
<html>
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" href="css/bootstrap.css" />
	<script type="text/javascript" src="js/jquery.js"></script>
	<title>登录</title>
	<style type="text/css">
		body{
			background-image:url(img/scribble_light.png);
		}
		.first{
			padding-top:100px;
			height:70px;
			text-align:center;
		}
		.sed{
			margin-top:-30px;
			margin-left:320px;
		}
		.sed-1{
			margin-left:100px;
		}
	</style>
		
	
</head>
<body>
	
	<div class="navbar navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container">
				<a href="#" class="brand">项目管理软件</a>
			</div>
		</div>
	</div>
	<div class="container">
		<div class="first">
			<div>
				<h1 style="height:50px;">欢迎使用项目管理软件</h1>
			</div>		
		</div>		
	</div>
	<div class="container">
		<div style="margin-left:400px;height:50px">
		<c:choose>
	  		<c:when test="${param.code == '10001'}">
	  			<div style="color:red"><h4>用户名或密码错误</h4></div>
	  		</c:when>
	  		<c:when test="${param.code == '10002' }">
	  			<div style="color:red">请先登录</div>
	  		</c:when>
	  		<c:when test="${param.code == '10003' }">
	  			<div style="color:red">验证码错误</div>
	  		</c:when>
  		</c:choose>
  		</div>
	
		<form class="sed" id="myform" action="login.action" method="post">
			<fieldset>
				
				<div class="control-group error">
					<label class="control-label">用户名</label>
					<div class="controls">
						<input type="text" class="input-xlarge" name="user.username"><span id="error_name"></span>								
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">密码</label>
					<div class="controls">
						<input type="password" class="input-xlarge" name="user.password"><span id="error_pwd"></span>								
					</div>
				</div>
				<div class="sed-1">
					<button class="btn btn-primary" type="button" id="btn">登录</button>
				</div>
			</fieldset>
		</form>
	</div>
	
	<script type="text/javascript">
		
		$(document).ready(function(){
			$("#btn").click(function(){
				var name = $("input[name = 'user.username']").val();
				var pwd = $("input[name = 'user.password']").val();
				
				if(name.trim() == ""){
					$("#error_name").html("请输入用户名");
					return;	
				}
				if(pwd == ""){
					$("#error_pwd").html("请输入密码");
					return;	
				}
				$("#myform").submit();
			});
		});

		
	</script>
</body>
</html>